{% extends "learing_logs/base.html" %}
{% load bootstrap3 %} <!-- 虽然base.html load了 但是子页面也得自己load -->
{% block header %}
    <h3>请登录你的账号</h3>
{% endblock header %}

{% block content %}
    {% if form.errors %}
        <p>你的的账号或密码不匹配.请重试</p>
    {% endif %}

    <form action="{% url 'users:login' %}" method="post" >
        {% csrf_token %}
        {% bootstrap_form form %}

        {% buttons %}
        <button name="submit" class="btn btn-primary">登　录</button>
        {% endbuttons %}
        
        <!-- 隐藏元素next 告诉Django登录成功后需要跳转到value的url -->
        <input type="hidden" name="next" value="{% url 'learing_logs:index' %}" />
    </form>


{% endblock content %}